(define-module (staging libravatar)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (gnu packages base)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages imagemagick)
  #:use-module (gnu packages pkg-config)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system cmake)
  )

;; (define-public bmake
;;   (package
;;     (name "bmake")
;;     (version "20200524")
;;     (source (origin
;;               (method url-fetch)
;;               (uri (string-append "http://www.crufty.net/ftp/pub/sjg/bmake-" version ".tar.gz"))
;;               (sha256
;;                (base32
;;                 "1nyscqwlxdm2qppivp73r04j31gvhw9achb0ivy2rbbxnjx2prvr"))

;;               (patches (list "./bootstrap-fix.patch"
;;                              "./fix-unexport-env-test.patch"))))
;;     (build-system gnu-build-system)
;;     (arguments
;;      `(#:tests? #f
;;        #:make-flags
;;        (let ((bash (assoc-ref %build-inputs "bash")))
;;          (list (string-append "SHELL=" bash "/bin/bash")))

;;        ;; #:phases (modify-phases %standard-phases
;;        ;;            (replace 'configure
;;        ;;              (lambda* (#:key (configure-flags '()) #:allow-other-keys)
;;        ;;                (let ((bash (which "bash")))
;;        ;;                  (setenv "SHELL" bash)
;;        ;;                  (setenv "CONFIG_SHELL" bash)
;;        ;;                  (apply invoke "sh" "boot-strap" configure-flags))))
;;        ;;            (delete 'build))
;;        ;; #:phases (modify-phases %standard-phases
;;        ;;            (replace 'build
;;        ;;              (lambda _
;;        ;;                (invoke "sh"
;;        ;;                        "make-bootstrap.sh")))
;;        ;;            ;; (add-after 'install 'install-plugin-headers
;;        ;;            ;;   (lambda* (#:key outputs #:allow-other-keys)
;;        ;;            ;;     (let* ((out (assoc-ref outputs "out"))
;;        ;;            ;;            (include-dir (string-append out "/include"))
;;        ;;            ;;            (install-include (cut install-file <> include-dir)))
;;        ;;            ;;       (mkdir-p include-dir)
;;        ;;            ;;       (for-each install-include
;;        ;;            ;;                 (find-files "standalone" "\\.h$"))
;;        ;;            ;;       (for-each install-include
;;        ;;            ;;                 (find-files "apache2" "\\.h$")))))
;;        ;;            )
;;        ))
;;     (native-inputs
;;      `(("sed" ,sed)
;;        ("coreutils" ,coreutils)))
;;     (home-page "http://www.crufty.net/help/sjg/bmake.html")
;;     (synopsis "Portable version of NetBSD @code{make}")
;;     (description "Portable version of NetBSD @code{make}")
;;     (license license:bsd-3)))

(define-public identiconpp
  (package
    (name "identiconpp")
    (version "0.7.1")
    (source
    (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://schlomp.space/tastytea/identiconpp.git")
           (commit version)))
     (file-name (git-file-name name version))
     (sha256
      (base32
       "12c4yl92kk4ck9gd0qg4ywk0kk77gcxrw44rznyn91lj3win9xfa"))))
    (build-system cmake-build-system)
    (arguments
     '(#:tests? #f))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (inputs
     `(("imagemagick" ,imagemagick)))
    (home-page "https://schlomp.space/tastytea/identiconpp")
    (synopsis "Generate identicons for C++")
    (description "identiconpp is a library to generate identicons for
C++.")
    (license license:gpl3)))

(define-public libravatarserv
  (package
    (name "libravatarserv")
    (version "0.7.2")
    (source
    (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://schlomp.space/tastytea/libravatarserv.git")
           (commit version)))
     (file-name (git-file-name name version))
     (sha256
      (base32
       "0jwpwia5i8m8h0cbkwj143fbk1954qwpk675rxrki9sra0vp9rsq"))))
    (build-system cmake-build-system)
    (arguments
     '(#:tests? #f))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (inputs
     `(("imagemagick" ,imagemagick)
       ("crypto++" ,crypto++)
       ("libxdg-basedir" ,libxdg-basedir)
       ("identiconpp" ,identiconpp)))
    (home-page "https://schlomp.space/tastytea/libravatarserv")
    (synopsis "Simple libravatar server")
    (description "libravatarserv is a simple libravatar server. It is
intended to be used as a CGI program. It is a free service and an open
specification for hosting profile images tied to email or OpenID
addresses.")
    (license license:gpl3)))


libravatarserv
